﻿@using CodeCamp.Models.EventMgmt
@using CodeCamp.Models.Shared
@model EventMgmtIndexViewModel
@{
    @* ViewBag.RegistrationUrl set in code - SetSharedViewBagProperties *@
    ViewBag.EventName = "";
    ViewBag.Title = "";
    if ((@Model != null) && (@Model.EventDisplayName != null))
    {
        ViewBag.Title = @Html.Encode(@Model.EventDisplayName + " | Event Management");
        ViewBag.EventName = @Model.EventDisplayName;
    }
    else
    {
        ViewBag.Title = "Code Camp | Event Management";
        ViewBag.EventName = "Code Camp";
    }
}

@section headaddon {
<style>
    table
    {
        border-collapse: collapse;
        border: solid 1px;
        margin: 0;
    }
    th
    {
        padding: 4px;
    }
    td 
    {
        padding: 4px;
    }
</style>
}

<h2 class="title">@ViewBag.Title</h2>
@if (User.IsInRole(CCRoles.RoleNames.BigCheeze))
{
    <p>@Html.ActionLink("Add New", "AddEvent")</p>
}

@Html.Partial("PartialViews/EventList", Model.EventList);


@section sidebar {
    <div id="subLinksContainer" class="widget rounded-10">
    <h3>Event Mgmt</h3>
    <ul>
        <li>@Html.ActionLink("EMail", "Index", "Email", new { eventName = Model.EventShortName }, null)</li>
        <li>@Html.ActionLink("Logs", "List", "Logs", new { eventName = Model.EventShortName }, null)</li>
        <li>@Html.ActionLink("Presenters", "Presenters", "EventMgmt", new { eventName = Model.EventShortName }, null)</li>
        <li>@Html.ActionLink("Site Users", "SiteUsers", "EventMgmt", new { eventName = Model.EventShortName }, null)</li>
        <li>@Html.ActionLink("Sponsors", "SponsorsList", "EventMgmt", new { eventName = Model.EventShortName }, null)</li>
    </ul>
    </div>
    @Html.Partial("SidebarCommonPartial")

    @if (User.IsInRole(CCRoles.RoleNames.BigCheeze))
    {
    <div id="subLinksContainer2" class="widget rounded-10">
    <ul>
        <li>@Html.ActionLink("Throw Exception", "ThrowException", new { eventName = Model.EventShortName, id = "1" })</li>
    </ul>
    </div>
    }
}
